package com.dianqiu.common.bean;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.dianqiu.base.bean.BaseTO;

/**
 * DqCodeTbl entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "dq_code_tbl", catalog = "dq_dev")
public class DqCodeTblTO  extends BaseTO implements java.io.Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String cdKey;
	private DqCodetypeTblTO dqCodetypeTbl;
	private String cdValue;
	private String cdDescription;
	private String cdName;
	private Set<DqMatchTO> dqMatchsForWeathCd = new HashSet<DqMatchTO>(0);
	private Set<DqMatchTO> dqMatchsForMthStatusCd = new HashSet<DqMatchTO>(0);
	private Set<DqMatchPoolTO> dqMatchPools = new HashSet<DqMatchPoolTO>(0);
	private Set<DqMatchPoolHistTO> dqMatchPoolHists = new HashSet<DqMatchPoolHistTO>(
			0);
	private Set<DqMatchHistTO> dqMatchHistsForWeathCd = new HashSet<DqMatchHistTO>(
			0);
	private Set<DqMatchHistTO> dqMatchHistsForMthStatusCd = new HashSet<DqMatchHistTO>(
			0);

	@Id
	@Column(name = "CD_KEY", unique = true, nullable = false, length = 13)
	public String getCdKey() {
		return this.cdKey;
	}

	public void setCdKey(String cdKey) {
		this.cdKey = cdKey;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CD_TYPE", nullable = false)
	public DqCodetypeTblTO getDqCodetypeTbl() {
		return this.dqCodetypeTbl;
	}

	public void setDqCodetypeTbl(DqCodetypeTblTO dqCodetypeTbl) {
		this.dqCodetypeTbl = dqCodetypeTbl;
	}

	@Column(name = "CD_VALUE", nullable = false, length = 200)
	public String getCdValue() {
		return this.cdValue;
	}

	public void setCdValue(String cdValue) {
		this.cdValue = cdValue;
	}

	@Column(name = "CD_NAME", nullable = false, length = 50)
	public String getCdName() {
		return cdName;
	}

	public void setCdName(String cdName) {
		this.cdName = cdName;
	}
	
	@Column(name = "CD_DESCRIPTION", length = 500)
	public String getCdDescription() {
		return this.cdDescription;
	}

	public void setCdDescription(String cdDescription) {
		this.cdDescription = cdDescription;
	}

	

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqCodeTblByWeathCd")
	public Set<DqMatchTO> getDqMatchsForWeathCd() {
		return this.dqMatchsForWeathCd;
	}

	public void setDqMatchsForWeathCd(Set<DqMatchTO> dqMatchsForWeathCd) {
		this.dqMatchsForWeathCd = dqMatchsForWeathCd;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqCodeTblByMthStatusCd")
	public Set<DqMatchTO> getDqMatchsForMthStatusCd() {
		return this.dqMatchsForMthStatusCd;
	}

	public void setDqMatchsForMthStatusCd(Set<DqMatchTO> dqMatchsForMthStatusCd) {
		this.dqMatchsForMthStatusCd = dqMatchsForMthStatusCd;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqCodeTbl")
	public Set<DqMatchPoolTO> getDqMatchPools() {
		return this.dqMatchPools;
	}

	public void setDqMatchPools(Set<DqMatchPoolTO> dqMatchPools) {
		this.dqMatchPools = dqMatchPools;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqCodeTbl")
	public Set<DqMatchPoolHistTO> getDqMatchPoolHists() {
		return this.dqMatchPoolHists;
	}

	public void setDqMatchPoolHists(Set<DqMatchPoolHistTO> dqMatchPoolHists) {
		this.dqMatchPoolHists = dqMatchPoolHists;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqCodeTblByWeathCd")
	public Set<DqMatchHistTO> getDqMatchHistsForWeathCd() {
		return this.dqMatchHistsForWeathCd;
	}

	public void setDqMatchHistsForWeathCd(
			Set<DqMatchHistTO> dqMatchHistsForWeathCd) {
		this.dqMatchHistsForWeathCd = dqMatchHistsForWeathCd;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "dqCodeTblByMthStatusCd")
	public Set<DqMatchHistTO> getDqMatchHistsForMthStatusCd() {
		return this.dqMatchHistsForMthStatusCd;
	}

	public void setDqMatchHistsForMthStatusCd(
			Set<DqMatchHistTO> dqMatchHistsForMthStatusCd) {
		this.dqMatchHistsForMthStatusCd = dqMatchHistsForMthStatusCd;
	}

}